import cv2

# 代表正数据集中开始和结束照片的数字
for n in range(1000, 1099):
    path = r'E:\pycharmWorkspace\trainTest\mask\has_mask/' + str(n) + '.jpg'
    # 读取图片
    img = cv2.imread(path)
    img = cv2.resize(img, (20, 20))  # 修改样本像素为20x20
    cv2.imwrite(r'E:\pycharmWorkspace\trainTest\mask\has_mask/' + str(n) + '.jpg', img)
    n += 1

# 代表正数据集中开始和结束照片的数字
for n in range(10000, 10099):
    path = r'E:\pycharmWorkspace\trainTest\mask\no_mask/' + str(n) + '.jpg'
    # 读取图片
    img = cv2.imread(path)
    img = cv2.resize(img, (80, 80))  # 修改样本像素为80x80
    cv2.imwrite(r'E:\pycharmWorkspace\trainTest\mask\no_mask/' + str(n) + '.jpg', img)
    n += 1